package ygg.encoding.swf.tag.codec
{
	import j.sus2maj7.encoding.*;
	import j.sus2maj7.context.*;
	
	import ygg.encoding.swf.tag.*;
	import ygg.encoding.swf.tag.object.*;
	
	public class ScriptLimitsCodec extends TagCodec
	{
		public function ScriptLimitsCodec()
		{
			super();
		}
		
		override public function decode(binary:IBinary, context:IContext=null):*
		{
			var retVal:ScriptLimits = new ScriptLimits();
			var b:TagBinary = binary as TagBinary;
			b.position = 0;
			b.syncBits();
			
			retVal.maxRecursionDepth = b.readUBits(16);
			retVal.scriptTimeoutSeconds = b.readUBits(16);
			
			trace(retVal.maxRecursionDepth, retVal.scriptTimeoutSeconds);
			
			return retVal;
		}
		
		override public function encode(o:*, context:IContext=null):IBinary
		{
			var b:TagBinary = new TagBinary();
			var obj:ScriptLimits = o as ScriptLimits;
			
			
			
			return b;
		}
	}
}